package com.zzr.demo.redis.II.controller;

import com.zzr.demo.redis.II.service.PipelineService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: xiaomi
 * @date: 2021/10/13
 * @description:
 */
@RestController
@RequestMapping("pipeling")
@Api(tags = "流水线：打包完成一系列命令")
@Slf4j
public class PipelineController {

    @Autowired
    PipelineService pipelineService;

    @GetMapping("/batchCommand")
    @ApiOperation("执行流水线")
    public boolean batchCommand() {
        pipelineService.batchCommand();
        return true;
    }


    @GetMapping("/doTransaction")
    @ApiOperation("执行事务")
    public boolean doTransaction() {
        pipelineService.doTransaction();
        return true;
    }
}
